<!DOCTYPE html>
<html>
<!-- 培训计划管理 -->

<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
        <script src="/static/js/common.js"></script>

</head>

<body>
    <div id="app" class="popupW100" v-cloak>
        <el-form label-position="right" :model="Form" status-icon :rules="rules" ref="ruleForm" label-width="100px"
            size="mini">
            <el-row>
                <el-col :span="11">
                    <el-col>
                        <div class="elst-select-mini">
                            <el-form-item>
                                <el-input size="mini">
                                    <template slot="prepend">
                                        <div> {{TrainingPlanManagement.yOrNTraining+mark.m}}</div>
                                    </template>
                                    <el-select @visible-change="visibleChange" v-model="Form.yOrNTraining" slot="suffix"
                                        :placeholder="TrainingPlanManagement.yOrNTraining">
                                        <el-option label="请选择" value=""></el-option>
                                        <el-option v-for="item in yOrNTraining" :label="item.value" :value="item.key">
                                        </el-option>
                                    </el-select>
                                </el-input>
                            </el-form-item>
                        </div>
                    </el-col>
                </el-col>
                <el-col :span="11" :offset="2">
                    <div class="elst-select-mini">
                        <el-form-item prop="HeadofTraining">
                            <el-input type="text" v-model="Form.HeadofTraining" autocomplete="off" size="mini">
                                <template slot="prepend">
                                    {{TrainingPlanManagement.HeadofTraining+mark.m}}
                                </template>
                            </el-input>
                        </el-form-item>
                    </div>
                </el-col>
                <el-col :span="11">
                    <div class="elst-select-mini">
                        <el-form-item prop="Trainingbudget">
                            <el-input type="text" v-model="Form.Trainingbudget" autocomplete="off" size="mini">
                                <template slot="prepend">
                                    {{TrainingPlanManagement.Trainingbudget+mark.m}}
                                </template>
                            </el-input>
                        </el-form-item>
                    </div>
                </el-col>
                <el-col :span="11" :offset="2">
                    <el-form-item>
                        <div class="elst-select-mini" style="margin-left: -100px">
                            <el-input size="mini">
                                <template slot="prepend">
                                    {{TrainingPlanManagement.Trainingtime+mark.m}}
                                </template>
                                <el-date-picker slot="suffix" v-model="Form.Trainingtime" type="date" size="mini"
                                    format="yyyy-MM-dd" value-format="yyyy-MM-dd" placeholder="选择时间">
                                </el-date-picker>
                            </el-input>
                        </div>
                    </el-form-item>
                </el-col>

                <el-col :span="11">
                    <div class="elst-select-mini">
                        <el-form-item prop="Trainingvenues">
                            <el-input type="text" v-model="Form.Trainingvenues" autocomplete="off" size="mini">
                                <template slot="prepend">
                                    {{TrainingPlanManagement.Trainingvenues+mark.m}}
                                </template>
                            </el-input>
                        </el-form-item>
                    </div>
                </el-col>
                <el-col :span="11" offset="2">
                    <div class="elst-select-mini">
                        <el-form-item prop="Trainer">
                            <el-input type="text" v-model="Form.Trainer" autocomplete="off" size="mini">
                                <template slot="prepend">
                                    {{TrainingPlanManagement.Trainer+mark.m}}
                                </template>
                            </el-input>
                        </el-form-item>
                    </div>
                </el-col>
                <el-col :span="11">
                    <el-col>
                        <div class="elst-select-mini">
                            <el-form-item>
                                <el-input size="mini">
                                    <template slot="prepend">
                                        <div> {{TrainingPlanManagement.Trainingmethods+mark.m}}</div>
                                    </template>
                                    <el-select @visible-change="visibleChange" v-model="Form.Trainingmethods" slot="suffix"
                                        :placeholder="TrainingPlanManagement.Trainingmethods">
                                        <el-option label="请选择" value=""></el-option>
                                        <el-option v-for="item in Trainingmethods" :label="item.value"
                                            :value="item.key">
                                        </el-option>
                                    </el-select>
                                </el-input>
                            </el-form-item>
                        </div>
                    </el-col>
                </el-col>
                <el-col :span="11" offset="2">
                    <div class="elst-select-mini">
                        <el-form-item prop="Trainers">
                            <el-input type="text" v-model="Form.Trainers" autocomplete="off" size="mini">
                                <template slot="prepend">
                                    {{TrainingPlanManagement.Trainers+mark.m}}
                                </template>
                            </el-input>
                        </el-form-item>
                    </div>
                </el-col>
            </el-row>
            <el-row type="flex" justify="end">
                <el-form-item>
                    <el-button type="primary" @click="onSubmitForm('ruleForm')">{{col.btnSave}}</el-button>
                    <el-button type="primary" @click="onSubmitForm('ruleForm')">{{col.btnCommit}}</el-button>
                    <el-button type="primary" @click="parent.ListItem.dialogVisible=false">{{col.btnBack}}</el-button>
                </el-form-item>
            </el-row>
        </el-form>
        <!--user建议替换为表名 需要与resource文件夹下js 中的对象保持一致  -->
        <el-dialog title="培训计划管理" :visible.sync="ListItem.dialogVisible" @close='closeDialog' width="80%" height="80%"
            top="10vh">
            <iframe ref="iframe" :src="ListItem.InputUrl" style="height:100%;width:100%" frameborder="0"></iframe>
        </el-dialog>
        </el-row>
    </div>
    <script type="text/javascript">
        var app = new Vue({
            el: '#app',
            data: {
                //父业传参
                id: '',
                imageUrl: '',

                value1: '',
                radio: '1',
                ListItem: ListItem,
                yOrNTraining: [],
                Trainingmethods: [],
                facilityvalue: [],
                Questiontype: [],
                Examinationmethods: [],
                formInline: {
                    model: {
                        PersonnelName: '',
                        Subordinatedepartments: '',
                        Nameofcertificate: '',
                        Issuancetime: '',
                        Maturitytime: '',
                        Certificatetype: '',
                        LicenseCoding: '',
                        Licensingauthority: '',
                        Termofvalidity: '',
                        Trainer: ''
                    },
                    offset: 0,
                    limit: 10
                },
                //业务表单内容
                Form: {
                    id: guidEmpty,
                    Trainingtime: '',
                    Trainingvenues: '',
                    Typesoftraining: '',
                    Trainingcontent: '',
                    state: '',
                    Trainer: '',
                    HeadofTraining: '',
                    Nameoftrainingplan: '',
                    yOrNTraining: '',
                    Trainingbudget: '',
                    Trainingmethods: '',
                    Trainers: [],
                    facilityvalue: '',
                    Questiontype: '',
                    Fullmarks: '',
                    Qualificationscore: '',
                    JudgmentQuestion: '',
                    Scoresforeachquestion1: '',
                    Singlechoicetopic: '',
                    Scoresforeachquestion2: '',
                    Multipletopics: '',
                    Scoresforeachquestion3: '',
                    Examinationstarttime: '',
                    Endtimeofexamination: '',
                    Examinationmethods: '',


                },
                //表单验证
                rules: {

                }
            },

            methods: {
                //解決edge下select bug
                visibleChange: function (isVisible) {
                    visibleChange(isVisible)
                },

                //提交数据
                onSubmitForm: function (formName) {
                    var mythis = this;
                    this.$refs[formName].validate(function (valid) {
                        //验证通过
                        if (valid) {
                            onSubmitForm(this, '/api/TrainingPlanManagement/Save', mythis.Form);
                        } else {
                            //验证失败
                            return false;
                        }
                    });
                },
                getData: function () {
                    getData(this, '/api/TrainingPlanManagement/get?id=' + this.id);
                },

                //删除方法
                onDelete: function () { onDelete(this, '/api/TrainingPlanManagement/DeleteMuti'); },
                //列表选择触发
                UserInputStatistics: function (val, id) { DialogShow(this, val, "TrainingPlanManagementInputPerson.html", id); },
                handleSelectionChange: function (val) { handleSelectionChange(this, val); },
                //获取分页数据
                GetPageData: function (currentIndex) { GetPageData(this, currentIndex, '/api/TrainingPlanManagement/GetList') },
                //pagesize改变 触发方法
                handleSizeChange: function (val) { handleSizeChange(this, val); },
                //跳页触发方法
                handleCurrentChange: function (val) { handleCurrentChange(this, val); },
                addTrainer: function (val, id) { DialogShow(this, val, "TrainingPlanManagementluruInputTrainer.html", id); },
                addTrainers: function (val, id) { DialogShow(this, val, "TrainingPlanManagementluruInputTrainers.html", id); },

            },
            mounted: function () {
                //初始化数据
                this.GetPageData(1);
                //列表高度自适应
                tablehigh(this);
                this.id = getUrlParam("id");
                this.getData();
                //获取下拉菜单内容
                this.yOrNTraining = getDicData('50');
                this.Trainingmethods = getDicData('w64');
                this.facilityvalue = getDicData('55');
                this.Questiontype = getDicData('28');
                this.Examinationmethods = getDicData('w64');
            }

        });
    </script>
</body>

</html>